package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiT_goods_topic;

//DAO
public interface T_goods_topicMapperBase {

	// 根据id查看
	@Select("SELECT * FROM T_GOODS_TOPIC  WHERE TOPIC_ID = #{topic_id}")
	public ApiT_goods_topic findT_goods_topicById(Integer topic_id);

	// 查看数据集
	@Select("SELECT * FROM T_goods_topic")
	public List<ApiT_goods_topic> findT_goods_topics();

	// 根据条件查看数据集
	public List<Map<String, Object>> findT_goods_topicsByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO T_GOODS_TOPIC (TITLE, INTRO, START_TIME, END_TIME, TOPIC_IMG, MEMBER_ID, STATUS, TEMPLATE_ID, SUM_COUNT, TYPE_ID, EXT_1, EXT_2, EXT_3, EXT_4, EXT_5) VALUES (#{title}, #{intro}, #{start_time}, #{end_time}, #{topic_img}, #{member_id}, #{status}, #{template_id}, #{sum_count}, #{type_id}, #{ext_1}, #{ext_2}, #{ext_3}, #{ext_4}, #{ext_5})")
	@Options(useGeneratedKeys = true, keyProperty = "topic_id")
	public int insertT_goods_topic(ApiT_goods_topic t_goods_topic);

	// 修改
	@Update("UPDATE T_GOODS_TOPIC SET TITLE = #{title}, INTRO = #{intro}, START_TIME = #{start_time}, END_TIME = #{end_time}, TOPIC_IMG = #{topic_img}, MEMBER_ID = #{member_id}, STATUS = #{status}, TEMPLATE_ID = #{template_id}, SUM_COUNT = #{sum_count}, TYPE_ID = #{type_id}, EXT_1 = #{ext_1}, EXT_2 = #{ext_2}, EXT_3 = #{ext_3}, EXT_4 = #{ext_4}, EXT_5 = #{ext_5} WHERE TOPIC_ID = #{topic_id}")
	public int updateT_goods_topic(ApiT_goods_topic t_goods_topic);

	// 删除
	@Delete("DELETE FROM T_GOODS_TOPIC  WHERE TOPIC_ID = #{topic_id}")
	public int deleteT_goods_topic(Integer topic_id);

	// Foreign keys revelant

	// region Indexs revelant

}
